﻿@model LERP.Domain.ReturnOrder
@using LERP.Domain.Enums
@using Sharp.Framework 
@using Sharp.Framework.Extensions 

@{
    ViewBag.Title = "退单详情";
    Layout = "~/Views/Shared/_Layout.cshtml";
} 
<div class="empty" style="text-align: left;background-color: #FFFCEB;font-size: 14px;font-family: 宋体,Arial,Lucida,Verdana,Helvetica,sans-serif;">
    
    <strong>退单编号: @this.ViewContext.RouteData.Values["id"] </strong>    <strong>状态: @(((ReturnOrderStatus)Model.Status).GetDescription())   </strong> 
</div>
    <fieldset> 
        <legend>基本信息 </legend>
        <ul class="list_form">
            <li> @Html.LabelFor(model => model.Customer)   @Html.DisplayFor(model => model.Customer.Name)  
         </li>
       <li>
                @Html.LabelFor(model => model.Contract)  
            @string.Format("[{0}]{1}({2}~{3})", Model.Contract.Code, Model.Contract.Subsidiary.Name, Model.Contract.BeginTime.ToString("yyyy-MM-dd"), Model.Contract.EndTime.ToString("yyyy-MM-dd"))
        </li>
        
        <li> @Html.LabelFor(model => model.Status)  
           
              @Model.Status.GetDescription() </li>
           <li> @Html.LabelFor(model => model.Creater)   @Html.DisplayFor(model => model.Creater.Name)  
         </li> 
        
        <li> @Html.LabelFor(model => model.ReturnDate)  @Model.ReturnDate.ToString("yyyy-MM-dd")  </li>
       <li> @Html.LabelFor(model => model.CustomerOrderNo)   
                    @(string.IsNullOrEmpty(Model.CustomerOrderNo)?"未填写":Model.CustomerOrderNo)  </li>
            <li> @Html.LabelFor(model => model.SafeNo)  @Html.DisplayFor(m => m.SafeNo) 
                    @(string.IsNullOrEmpty(Model.SafeNo)?"未填写":Model.SafeNo) 
            </li> 
        <li> @Html.LabelFor(model => model.LogisticsProvider) 
               @(null==Model.LogisticsProvider?"未填写":Model.LogisticsProvider.Name)    </li>
        <li> @Html.LabelFor(model => model.CarrierCode)  
                
               @(string.IsNullOrEmpty(Model.CarrierCode)?"未填写":Model.CarrierCode)   </li> 
            <li> @Html.LabelFor(model => model.DeliveryNo)  
                
               @(string.IsNullOrEmpty(Model.DeliveryNo)?"未填写":Model.DeliveryNo)  
            </li> 
             @if (Model.Status != ReturnOrderStatus.Draft||Model.Status != ReturnOrderStatus.Cancel)
             {
                 <li> @Html.LabelFor(model => model.WarehouseAmount)  @Html.DisplayFor(m => m.WarehouseAmount) </li>
                 <li> @Html.LabelFor(model => model.WarehouseCode) 
               @(string.IsNullOrEmpty(Model.WarehouseCode)?"未填写":Model.WarehouseCode)  
                 </li>
                 <li>
                     <label>验收回单</label>   
                     @(Model.Confirmation ? "已验收" : "未验收") 
                 </li>
             }
        <li> @Html.LabelFor(model => model.Remark)   @Html.DisplayFor(m => m.Remark) </li>
         
        
        <li id="li_Amount" style="display: @((Model.IsGoods)?"none":"inline");"> @Html.LabelFor(model => model.Amount)   @Html.DisplayFor(m => m.Amount) </li>
        
        </ul> 
        
         
    </fieldset>
  <fieldset id="fieldset_goods" style="display: @(Model.IsGoods?"":"none");"> 
      <legend>货品明细 </legend> 
       <table class="table_list" id="goods_table" style="width: 99%;">
         <tr>
                <th style="width: 80px;">国际条码</th>
                <th>品名规格</th>
                <th style="width: 80px;">单价</th>
                <th style="width: 30px;">单位</th>
                <th style="width: 60px;">退货数量</th> 
         </tr>   
           @foreach (var item in Model.Items)
           {
               <tr>
                   <td>@item.Goods.Gencod</td>
                   <td>@item.Goods.Name</td>
                   <td>@item.Price</td>
                   <td>@item.Goods.SellUnit</td>
                   <td>@item.Number</td>
               </tr>
           }           
       </table>
        <div style="float: right; margin-top: 25px; width: 300px; text-align: right;">
            <div style="margin-bottom: 5px;">退单金额: <label id="order_sum">@Model.Amount</label> 元 
               
            </div> 
        </div>
  </fieldset>

  
   
    <br/>
    
<br/>   